﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DTN.Core.Utilities;

namespace com.dtn.deals
{
    public class tbl_Category
    {
        private System.Int32 _ID;

        public System.Int32 ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private System.String _cateName;

        public System.String CateName
        {
            get { return _cateName; }
            set { _cateName = value; }
        }
        private System.Int32 _cateParrent;

        public System.Int32 CateParrent
        {
            get { return _cateParrent; }
            set { _cateParrent = value; }
        }

        private System.DateTime _cDate;

        public System.DateTime CDate
        {
            get { return _cDate; }
            set { _cDate = value; }
        }

        private System.String _images;

        public System.String Images
        {
            get { return _images; }
            set { _images = value; }
        }

        private System.Int32 _isHome;

        public System.Int32 IsHome
        {
            get { return _isHome; }
            set { _isHome = value; }
        }

        private System.Int32 _order;

        public System.Int32 Order
        {
            get { return _order; }
            set { _order = value; }
        }

        private System.Int32 _groupFilterId;

        public System.Int32 GroupFilterId
        {
            get { return _groupFilterId; }
            set { _groupFilterId = value; }
        }
        private System.String _filterId;

        public System.String FilterId
        {
            get { return _filterId; }
            set { _filterId = value; }
        }


        public tbl_Category() { }
        //Cuong Code
        public tbl_Category(DataRow info)
        {
            _ID = ConvertUtility.ToInt32(info["ID"]);
            _cateName = ConvertUtility.ToString(info["cateName"]);
            _cateParrent = ConvertUtility.ToInt32(info["cateParrent"]);
            _images = ConvertUtility.ToString(info["images"]);
            _cDate = ConvertUtility.ToDateTime(info["cDate"]);
            _order = ConvertUtility.ToInt32(info["Order"]);
            _isHome = ConvertUtility.ToInt32(info["IsHome"]);
            _groupFilterId = Convert.ToInt32(info["GroupFilterId"]);
            _filterId =Convert.ToString(info["FilterId"]);

        }
        public tbl_Category(DataRowView info)
        {
            _ID = ConvertUtility.ToInt32(info["ID"]);
            _cateName = ConvertUtility.ToString(info["cateName"]);
            _cateParrent = ConvertUtility.ToInt32(info["cateParrent"]);
            _images = ConvertUtility.ToString(info["images"]);
            _cDate = ConvertUtility.ToDateTime(info["cDate"]);
            _order = ConvertUtility.ToInt32(info["Order"]);
            _isHome = ConvertUtility.ToInt32(info["IsHome"]);
            _groupFilterId = Convert.ToInt32(info["GroupFilterId"]);
            _filterId = Convert.ToString(info["FilterId"]);
        }
        public tbl_Category(SqlDataReader info)
        {
            _ID = ConvertUtility.ToInt32(info["ID"]);
            _cateName = ConvertUtility.ToString(info["cateName"]);
            _cateParrent = ConvertUtility.ToInt32(info["cateParrent"]);
            _images = ConvertUtility.ToString(info["images"]);
            _cDate = ConvertUtility.ToDateTime(info["cDate"]);
            _order = ConvertUtility.ToInt32(info["Order"]);
            _isHome = ConvertUtility.ToInt32(info["IsHome"]);
            _groupFilterId = Convert.ToInt32(info["GroupFilterId"]);
            _filterId = Convert.ToString(info["FilterId"]);
        }
    }
}
